package cn.tedu.boot08.mapper;

import cn.tedu.boot08.entity.Weibo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WeiboMapper {
    @Insert("INSERT INTO weibo VALUES(NULL,#{content},#{url})")
    void insert(Weibo weibo);
    @Select("SELECT * FROM weibo")
    List<Weibo>select();
    @Delete("DELETE FROM weibo WHERE id=#{id}")
    void deleteById(int id);

    @Select("SELECT url FROM weibo WHERE id=#{id}")
    String selectUrlById(int id);


}
